import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

/* Layout */
import Layout from '@/layout'

/* Router Modules */
// import componentsRouter from './modules/components'
// import chartsRouter from './modules/charts'
// import tableRouter from './modules/table'
// import nestedRouter from './modules/nested'

/**
 * Note: sub-menu only appear when route children.length >= 1
 * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
 *
 * hidden: true                   if set true, item will not show in the sidebar(default is false)
 * alwaysShow: true               if set true, will always show the root menu
 *                                if not set alwaysShow, when item has more than one children route,
 *                                it will becomes nested mode, otherwise not show the root menu
 * redirect: noRedirect           if set noRedirect will no redirect in the breadcrumb
 * name:'router-name'             the name is used by <keep-alive> (must set!!!)
 * meta : {
    roles: ['admin','editor']    control the page roles (you can set multiple roles)
    title: 'title'               the name show in sidebar and breadcrumb (recommend set)
    icon: 'svg-name'/'el-icon-x' the icon show in the sidebar
    noCache: true                if set true, the page will no be cached(default is false)
    affix: true                  if set true, the tag will affix in the tags-view
    breadcrumb: false            if set false, the item will hidden in breadcrumb(default is true)
    activeMenu: '/example/list'  if set path, the sidebar will highlight the path you set
  }
 */

/**
 * constantRoutes
 * a base page that does not have permission requirements
 * all roles can be accessed
 */
export const constantRoutes = [
  {
    path: '/redirect',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/redirect/:path(.*)',
        component: () => import('@/views/redirect/index')
      }
    ]
  },
  {
    path: '/login',
    component: () => import('@/views/login/index'),
    hidden: true
  },
  {
    path: '/auth-redirect',
    component: () => import('@/views/login/auth-redirect'),
    hidden: true
  },
  {
    path: '/404',
    component: () => import('@/views/error-page/404'),
    hidden: true
  },
  {
    path: '/401',
    component: () => import('@/views/error-page/401'),
    hidden: true
  },
  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    children: [
      {
        path: 'dashboard',
        component: () => import('@/views/dashboard/index'),
        name: 'Dashboard',
        meta: { title: '首页', icon: 'dashboard', affix: true }
      }
    ]
  }
  // {
  //   path: '/documentation',
  //   component: Layout,
  //   children: [
  //     {
  //       path: 'index',
  //       component: () => import('@/views/documentation/index'),
  //       name: 'Documentation',
  //       meta: { title: 'Documentation', icon: 'documentation', affix: true }
  //     }
  //   ]
  // },
  // {
  //   path: '/guide',
  //   component: Layout,
  //   redirect: '/guide/index',
  //   children: [
  //     {
  //       path: 'index',
  //       component: () => import('@/views/guide/index'),
  //       name: 'Guide',
  //       meta: { title: 'Guide', icon: 'guide', noCache: true }
  //     }
  //   ]
  // },
  // {
  //   path: '/profile',
  //   component: Layout,
  //   redirect: '/profile/index',
  //   hidden: true,
  //   children: [
  //     {
  //       path: 'index',
  //       component: () => import('@/views/profile/index'),
  //       name: 'Profile',
  //       meta: { title: 'Profile', icon: 'user', noCache: true }
  //     }
  //   ]
  // }
]

/**
 * asyncRoutes
 * the routes that need to be dynamically loaded based on user roles
 */
export const asyncRoutes = [
  {
    path: '/admin-permission',
    component: Layout,
    redirect: '/admin-permission/index',
    alwaysShow: true, // will always show the root menu
    name: 'AdminAdmin',
    meta: {
      title: '后台权限',
      icon: 'lock',
      roles: ['admin'] // you can set roles in root nav
    },
    children: [
      {
        path: 'index',
        component: () => import('@/views/admin-permission/index'),
        name: 'AdminIndex',
        meta: {
          title: '管理员',
          roles: ['admin'] // or you can only set roles in sub nav
        }
      },
      {
        path: 'role',
        component: () => import('@/views/admin-permission/role'),
        name: 'AdminRole',
        meta: {
          title: '角色管理',
          roles: ['admin'] // or you can only set roles in sub nav
        }
      },
      {
        path: 'permission',
        component: () => import('@/views/admin-permission/permission'),
        name: 'Adminpermission',
        meta: {
          title: '菜单权限',
          roles: ['admin'] // or you can only set roles in sub nav
        }
      }
    ]
  },
  {
    path: '/statistics',
    component: Layout,
    redirect: '/statistics/index',
    alwaysShow: true, // will always show the root menu
    name: 'Statistics',
    meta: {
      title: '数据统计',
      icon: 'lock',
      roles: ['admin'] // you can set roles in root nav
    },
    children: [
      {
        path: 'index',
        component: () => import('@/views/statistics/index'),
        name: 'StatisticsIndex',
        meta: {
          title: '日常统计',
          roles: ['admin'] // or you can only set roles in sub nav
        }
      },
      {
        path: 'userDelay',
        component: () => import('@/views/statistics/userDelay'),
        name: 'StatisticsUserDelay',
        meta: {
          title: '达人加速',
          roles: ['admin'] // or you can only set roles in sub nav
        }
      }
    ]
  },
  {
    path: '/system-manage',
    component: Layout,
    redirect: '/system-manage/system-set/index',
    alwaysShow: true, // will always show the root menu
    name: 'SystemManage',
    meta: {
      title: '系统管理',
      icon: 'lock',
      roles: ['admin'] // you can set roles in root nav
    },
    children: [
      {
        path: 'system-log',
        component: () => import('@/views/system-manage/system-log'),
        name: 'SystemLog',
        meta: {
          title: '后台日志',
          roles: ['admin'] // or you can only set roles in sub nav
        }
      },
      {
        path: 'system-set/index',
        component: () => import('@/views/system-manage/system-set/index'),
        name: 'SystemSet',
        meta: {
          title: '系统设置',
          roles: ['admin'] // or you can only set roles in sub nav
        }
      },
      {
        path: 'photo-manage',
        component: () => import('@/views/system-manage/photo-manage'),
        name: 'PhotoManage',
        meta: {
          title: '图片管理',
          roles: ['admin'] // or you can only set roles in sub nav
        }
      },
      {
        path: 'version',
        component: () => import('@/views/system-manage/version'),
        name: 'Version',
        meta: {
          title: '版本控制',
          roles: ['admin'] // or you can only set roles in sub nav
        }
      },
      {
        path: 'keywords',
        component: () => import('@/views/system-manage/keywords'),
        name: 'Keywords',
        meta: {
          title: '屏蔽关键词',
          roles: ['admin'] // or you can only set roles in sub nav
        }
      },
      {
        path: 'reject-ip',
        component: () => import('@/views/system-manage/reject-ip'),
        name: 'RejectIp',
        meta: {
          title: '封禁IP',
          roles: ['admin'] // or you can only set roles in sub nav
        }
      }
    ]
  },
  {
    path: '/content-manage',
    component: Layout,
    redirect: '/content-manage/news',
    alwaysShow: true, // will always show the root menu
    name: 'ContentManage',
    meta: {
      title: '内容管理',
      icon: 'lock',
      roles: ['admin'] // you can set roles in root nav
    },
    children: [
      {
        path: 'news',
        component: () => import('@/views/content-manage/news'),
        name: 'News',
        meta: {
          title: '新闻列表',
          roles: ['admin'] // or you can only set roles in sub nav
        }
      },
      {
        path: 'notice',
        component: () => import('@/views/content-manage/notice'),
        name: 'Notice',
        meta: {
          title: '公告列表',
          roles: ['admin'] // or you can only set roles in sub nav
        }
      }
    ]
  },
  {
    path: '/charges',
    component: Layout,
    redirect: '/charges/index',
    alwaysShow: true, // will always show the root menu
    name: 'Charges',
    meta: {
      title: '手续费',
      icon: 'lock',
      roles: ['admin'] // you can set roles in root nav
    },
    children: [
      {
        path: 'index',
        component: () => import('@/views/charges/index'),
        name: 'ChargesIndex',
        meta: {
          title: '手续费',
          roles: ['admin'] // or you can only set roles in sub nav
        }
      },
      {
        path: 'bonus',
        component: () => import('@/views/charges/bonus'),
        name: 'Bonus',
        meta: {
          title: '分红详情',
          roles: ['admin'] // or you can only set roles in sub nav
        }
      }
    ]
  },
  {
    path: '/welfare-sector',
    component: Layout,
    redirect: '/welfare-sector/welfare-shop',
    alwaysShow: true,
    name: 'WelfareSector',
    meta: {
      title: '福利板块',
      icon: 'lock',
      roles: ['admin']
    },
    children: [
      {
        path: 'welfare-shop',
        component: () => import('@/views/welfare-sector/welfare-shop'),
        name: 'WelfareShop',
        meta: {
          title: '福利商品',
          roles: ['admin']
        }
      },
      {
        path: 'welfare-order',
        component: () => import('@/views/welfare-sector/welfare-order'),
        name: 'WelfareOrder',
        meta: {
          title: '福利订单',
          roles: ['admin']
        }
      },
      {
        path: 'welfare-log',
        component: () => import('@/views/welfare-sector/welfare-log'),
        name: 'WelfareOLog',
        meta: {
          title: '福利操作日志',
          roles: ['admin']
        }
      }
    ]
  },
  {
    path: '/yl-housekeeper',
    component: Layout,
    redirect: '/yl-housekeeper/audit',
    alwaysShow: true,
    name: 'YLHousekeeper',
    meta: {
      title: '友邻管家',
      icon: 'lock',
      roles: ['admin']
    },
    children: [
      {
        path: 'audit',
        component: () => import('@/views/yl-housekeeper/audit'),
        name: 'YLHousekeeperAudit',
        meta: {
          title: '友邻管家审核',
          roles: ['admin']
        }
      }, {
        path: 'list',
        component: () => import('@/views/yl-housekeeper/list'),
        name: 'YLHousekeeperList',
        meta: {
          title: '友邻管家列表',
          roles: ['admin']
        }
      }, {
        path: 'all-bonus',
        component: () => import('@/views/yl-housekeeper/all-bonus'),
        name: 'YLHousekeeperAllBonus',
        meta: {
          title: '友邻管家总分红',
          roles: ['admin']
        }
      }, {
        path: 'bonus-log',
        component: () => import('@/views/yl-housekeeper/bonus-log'),
        name: 'YLHousekeeperBonusLog',
        meta: {
          title: '友邻管家分红日志',
          roles: ['admin']
        }
      }, {
        path: 'bonus',
        component: () => import('@/views/yl-housekeeper/bonus'),
        name: 'YLHousekeeperBonus',
        meta: {
          title: '友邻管家分红',
          roles: ['admin']
        }
      }
    ]
  },
  {
    path: '/tourist-route',
    component: Layout,
    redirect: '/tourist-route/services',
    alwaysShow: true,
    name: 'TouristRoute',
    meta: {
      title: '旅游路线',
      icon: 'lock',
      roles: ['admin']
    },
    children: [
      {
        path: 'services',
        component: () => import('@/views/tourist-route/services'),
        name: 'TouristRouteServices',
        meta: {
          title: '旅行服务',
          roles: ['admin']
        }
      },
      {
        path: 'category',
        component: () => import('@/views/tourist-route/category'),
        name: 'TouristRouteCategory',
        meta: {
          title: '线路分类',
          roles: ['admin']
        }
      },
      {
        path: 'manage',
        component: () => import('@/views/tourist-route/manage'),
        name: 'TouristRouteManage',
        meta: {
          title: '路线管理',
          roles: ['admin']
        }
      },
      {
        path: 'order-list',
        component: () => import('@/views/tourist-route/order-list'),
        name: 'TouristRouteOrderList',
        meta: {
          title: '旅游订单',
          roles: ['admin']
        }
      }
    ]
  },
  {
    path: '/travel',
    component: Layout,
    redirect: '/travel/train',
    alwaysShow: true,
    name: 'Travel',
    meta: {
      title: '旅行',
      icon: 'lock',
      roles: ['admin']
    },
    children: [
      {
        path: 'train',
        component: () => import('@/views/travel/train'),
        name: 'TravelTrain',
        meta: {
          title: '高铁',
          roles: ['admin']
        }
      },
      {
        path: 'flight',
        component: () => import('@/views/travel/flight'),
        name: 'TravelFlight',
        meta: {
          title: '飞机',
          roles: ['admin']
        }
      },
      {
        path: 'ticket',
        component: () => import('@/views/travel/ticket'),
        name: 'TravelTicket',
        meta: {
          title: '景点门票',
          roles: ['admin']
        }
      },
      {
        path: 'hotel',
        component: () => import('@/views/travel/hotel'),
        name: 'TravelHotel',
        meta: {
          title: '酒店',
          roles: ['admin']
        }
      }
    ]
  },
  {
    path: '/member-manage',
    component: Layout,
    redirect: '/member-manage/withdrawal-manage',
    alwaysShow: true,
    name: 'MemberManage',
    meta: {
      title: '会员管理',
      icon: 'lock',
      roles: ['admin']
    },
    children: [
      {
        path: 'withdrawal-manage',
        component: () => import('@/views/member-manage/withdrawal-manage'),
        name: 'WithdrawalManage',
        meta: {
          title: '提现管理',
          roles: ['admin']
        }
      },
      {
        path: 'member-list',
        component: () => import('@/views/member-manage/member-list'),
        name: 'MemberList',
        meta: {
          title: '会员列表',
          roles: ['admin']
        }
      },
      {
        path: 'realname-authentication',
        component: () => import('@/views/member-manage/realname-authentication'),
        name: 'RealnameAuthentication',
        meta: {
          title: '实人认证',
          roles: ['admin']
        }
      },
      {
        path: 'user-travel-bag',
        component: () => import('@/views/member-manage/user-travel-bag'),
        name: 'UserTravelBag',
        meta: {
          title: '用户旅行包',
          roles: ['admin']
        }
      },
      {
        path: 'internal-wiring',
        component: () => import('@/views/member-manage/internal-wiring'),
        name: 'InternalWiring',
        meta: {
          title: '内部排线',
          roles: ['admin']
        }
      },
      {
        path: 'service-provider',
        component: () => import('@/views/member-manage/service-provider'),
        name: 'ServiceProvider',
        meta: {
          title: '服务商',
          roles: ['admin']
        }
      }
    ]
  },
  {
    path: '/configurate',
    component: Layout,
    redirect: '/configurate/area-list',
    alwaysShow: true,
    name: 'Configurate',
    meta: {
      title: '配置',
      icon: 'lock',
      roles: ['admin']
    },
    children: [
      {
        path: 'area-list',
        component: () => import('@/views/configurate/area-list'),
        name: 'AreaList',
        meta: {
          title: '地区数据',
          roles: ['admin']
        }
      },
      {
        path: 'community-list',
        component: () => import('@/views/configurate/community-list'),
        name: 'CommunityList',
        meta: {
          title: '小区数据',
          roles: ['admin']
        }
      },
      {
        path: 'service-telephone',
        component: () => import('@/views/configurate/service-telephone'),
        name: 'ServiceTelephone',
        meta: {
          title: '服务电话',
          roles: ['admin']
        }
      },
      {
        path: 'service-charge',
        component: () => import('@/views/configurate/service-charge'),
        name: 'ServiceCharge',
        meta: {
          title: '手续费',
          roles: ['admin']
        }
      },
      {
        path: 'ylmaster',
        component: () => import('@/views/configurate/ylmaster'),
        name: 'YLMaster',
        meta: {
          title: '友邻达人',
          roles: ['admin']
        }
      },
      {
        path: 'travel-bag',
        component: () => import('@/views/configurate/travel-bag'),
        name: 'TravelBag',
        meta: {
          title: '旅行包',
          roles: ['admin']
        }
      },
      {
        path: 'advert-bag',
        component: () => import('@/views/configurate/advert-bag'),
        name: 'AdvertBag',
        meta: {
          title: '广告包',
          roles: ['admin']
        }
      },
      {
        path: 'vip-configurate',
        component: () => import('@/views/configurate/vip-configurate'),
        name: 'VipConfigurate',
        meta: {
          title: 'VIP配置',
          roles: ['admin']
        }
      }
    ]
  },
  {
    path: '/regift-transaction',
    component: Layout,
    redirect: '/regift-transaction/advertising-new',
    alwaysShow: true,
    name: 'RegiftTransaction',
    meta: {
      title: '转赠交易',
      icon: 'lock',
      roles: ['admin']
    },
    children: [
      {
        path: 'advertising-new',
        component: () => import('@/views/regift-transaction/advertising-new'),
        name: 'AdvertisingNew',
        meta: {
          title: '新手广告包',
          roles: ['admin']
        }
      },
      {
        path: 'transaction-log',
        component: () => import('@/views/regift-transaction/transaction-log'),
        name: 'TransactionLog',
        meta: {
          title: '转赠记录',
          roles: ['admin']
        }
      },
      {
        path: 'advertising-pend',
        component: () => import('@/views/regift-transaction/advertising-pend'),
        name: 'AdvertisingPend',
        meta: {
          title: '广告包挂单',
          roles: ['admin']
        }
      },
      {
        path: 'advertising-order',
        component: () => import('@/views/regift-transaction/advertising-order'),
        name: 'AdvertisingOrder',
        meta: {
          title: '广告包订单',
          roles: ['admin']
        }
      }
    ]
  },
  {
    path: '/recharge-pay',
    component: Layout,
    redirect: '/recharge-pay/mobile/product',
    alwaysShow: true,
    name: 'RechargePay',
    meta: {
      title: '缴费',
      icon: 'lock',
      roles: ['admin']
    },
    children: [
      {
        path: 'mobile',
        component: () => import('@/views/recharge-pay/mobile/index'),
        name: 'RechargePayMobile',
        meta: {
          title: '话费',
          roles: ['admin']
        },
        children: [
          {
            path: 'product',
            component: () => import('@/views/recharge-pay/mobile/product'),
            name: 'RechargePayMobileProduct',
            meta: {
              title: '产品',
              roles: ['admin']
            }
          },
          {
            path: 'order',
            component: () => import('@/views/recharge-pay/mobile/order'),
            name: 'RechargePayMobileOrder',
            meta: {
              title: '订单',
              roles: ['admin']
            }
          }
        ]
      },
      {
        path: 'electric',
        component: () => import('@/views/recharge-pay/electric/index'),
        name: 'RechargePayElectric',
        meta: {
          title: '电费',
          roles: ['admin']
        },
        children: [
          {
            path: 'product',
            component: () => import('@/views/recharge-pay/electric/product'),
            name: 'RechargePayElectricProduct',
            meta: {
              title: '产品',
              roles: ['admin']
            }
          },
          {
            path: 'area',
            component: () => import('@/views/recharge-pay/electric/area'),
            name: 'RechargePayElectricArea',
            meta: {
              title: '地区',
              roles: ['admin']
            }
          },
          {
            path: 'order',
            component: () => import('@/views/recharge-pay/electric/order'),
            name: 'RechargePayElectricOrder',
            meta: {
              title: '订单',
              roles: ['admin']
            }
          }
        ]
      }
    ]
  },
  // {
  //   path: '/icon',
  //   component: Layout,
  //   children: [
  //     {
  //       path: 'index',
  //       component: () => import('@/views/icons/index'),
  //       name: 'Icons',
  //       meta: { title: 'Icons', icon: 'icon', noCache: true }
  //     }
  //   ]
  // },

  /** when your routing map is too long, you can split it into small modules **/
  // componentsRouter,
  // chartsRouter,
  // nestedRouter,
  // tableRouter,

  // {
  //   path: '/example',
  //   component: Layout,
  //   redirect: '/example/list',
  //   name: 'Example',
  //   meta: {
  //     title: 'Example',
  //     icon: 'el-icon-s-help'
  //   },
  //   children: [
  //     {
  //       path: 'create',
  //       component: () => import('@/views/example/create'),
  //       name: 'CreateArticle',
  //       meta: { title: 'Create Article', icon: 'edit' }
  //     },
  //     {
  //       path: 'edit/:id(\\d+)',
  //       component: () => import('@/views/example/edit'),
  //       name: 'EditArticle',
  //       meta: { title: 'Edit Article', noCache: true, activeMenu: '/example/list' },
  //       hidden: true
  //     },
  //     {
  //       path: 'list',
  //       component: () => import('@/views/example/list'),
  //       name: 'ArticleList',
  //       meta: { title: 'Article List', icon: 'list' }
  //     }
  //   ]
  // },

  // {
  //   path: '/tab',
  //   component: Layout,
  //   children: [
  //     {
  //       path: 'index',
  //       component: () => import('@/views/tab/index'),
  //       name: 'Tab',
  //       meta: { title: 'Tab', icon: 'tab' }
  //     }
  //   ]
  // },

  // {
  //   path: '/error',
  //   component: Layout,
  //   redirect: 'noRedirect',
  //   name: 'ErrorPages',
  //   meta: {
  //     title: 'Error Pages',
  //     icon: '404'
  //   },
  //   children: [
  //     {
  //       path: '401',
  //       component: () => import('@/views/error-page/401'),
  //       name: 'Page401',
  //       meta: { title: '401', noCache: true }
  //     },
  //     {
  //       path: '404',
  //       component: () => import('@/views/error-page/404'),
  //       name: 'Page404',
  //       meta: { title: '404', noCache: true }
  //     }
  //   ]
  // },

  // {
  //   path: '/error-log',
  //   component: Layout,
  //   children: [
  //     {
  //       path: 'log',
  //       component: () => import('@/views/error-log/index'),
  //       name: 'ErrorLog',
  //       meta: { title: 'Error Log', icon: 'bug' }
  //     }
  //   ]
  // },

  // {
  //   path: '/excel',
  //   component: Layout,
  //   redirect: '/excel/export-excel',
  //   name: 'Excel',
  //   meta: {
  //     title: 'Excel',
  //     icon: 'excel'
  //   },
  //   children: [
  //     {
  //       path: 'export-excel',
  //       component: () => import('@/views/excel/export-excel'),
  //       name: 'ExportExcel',
  //       meta: { title: 'Export Excel' }
  //     },
  //     {
  //       path: 'export-selected-excel',
  //       component: () => import('@/views/excel/select-excel'),
  //       name: 'SelectExcel',
  //       meta: { title: 'Export Selected' }
  //     },
  //     {
  //       path: 'export-merge-header',
  //       component: () => import('@/views/excel/merge-header'),
  //       name: 'MergeHeader',
  //       meta: { title: 'Merge Header' }
  //     },
  //     {
  //       path: 'upload-excel',
  //       component: () => import('@/views/excel/upload-excel'),
  //       name: 'UploadExcel',
  //       meta: { title: 'Upload Excel' }
  //     }
  //   ]
  // },

  // {
  //   path: '/zip',
  //   component: Layout,
  //   redirect: '/zip/download',
  //   alwaysShow: true,
  //   name: 'Zip',
  //   meta: { title: 'Zip', icon: 'zip' },
  //   children: [
  //     {
  //       path: 'download',
  //       component: () => import('@/views/zip/index'),
  //       name: 'ExportZip',
  //       meta: { title: 'Export Zip' }
  //     }
  //   ]
  // },

  // {
  //   path: '/pdf',
  //   component: Layout,
  //   redirect: '/pdf/index',
  //   children: [
  //     {
  //       path: 'index',
  //       component: () => import('@/views/pdf/index'),
  //       name: 'PDF',
  //       meta: { title: 'PDF', icon: 'pdf' }
  //     }
  //   ]
  // },
  // {
  //   path: '/pdf/download',
  //   component: () => import('@/views/pdf/download'),
  //   hidden: true
  // },

  // {
  //   path: '/theme',
  //   component: Layout,
  //   children: [
  //     {
  //       path: 'index',
  //       component: () => import('@/views/theme/index'),
  //       name: 'Theme',
  //       meta: { title: 'Theme', icon: 'theme' }
  //     }
  //   ]
  // },

  // {
  //   path: '/clipboard',
  //   component: Layout,
  //   children: [
  //     {
  //       path: 'index',
  //       component: () => import('@/views/clipboard/index'),
  //       name: 'ClipboardDemo',
  //       meta: { title: 'Clipboard', icon: 'clipboard' }
  //     }
  //   ]
  // },

  // {
  //   path: 'external-link',
  //   component: Layout,
  //   children: [
  //     {
  //       path: 'https://github.com/PanJiaChen/vue-element-admin',
  //       meta: { title: 'External Link', icon: 'link' }
  //     }
  //   ]
  // },

  // 404 page must be placed at the end !!!
  { path: '*', redirect: '/404', hidden: true }
]

const createRouter = () => new Router({
  // mode: 'history', // require service support
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRoutes
})

const router = createRouter()

// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
  const newRouter = createRouter()
  router.matcher = newRouter.matcher // reset router
}

export default router
